<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
    // 类.prototype   对象.__proto__
    class Animal {
      eat() {
        console.log("吃东西")
      }
    }

    class People extends Animal {   // People.prototype.__proto__  => Animal.prototype
      say() {
        console.log("hello")
      }
    }


    const p1 = new People()
    p1.eat()
    // p1.eat => p1.__proto__.eat  => People.prototype.eat => People.prototype.__proto__.eat => Animal.prototype.eat
    //

  </script>
</body>
</html>
